<?php

namespace PhpQq\WebQq;

class FriendList {

    private static $instance;
    private $friend;
    private $group;
    private $loginUserInfo;
    
    public function __construct() {
        self::$instance = $this;
        $this->inbox = new \Threaded;
        $this->outbox = new \Threaded;
    }

    public static function getInstance() {
        if (!self::$instance instanceof self) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    /**
     * 设置好友列表
     * @param type $friend
     * @return type
     */
    public function setFriend($friend) {
        $this->friend = $friend;
    }
    
    /**
     * 设置登录用户的信息
     * @param type $friend
     * @return type
     */
    public function setLoginUserInfo($loginUserInfo) {
        $this->loginUserInfo = $loginUserInfo;
    }

    /**
     * 设置群列表
     * @param array $group
     * @return type
     */
    public function setGroup($group) {
        $this->group = $group;
    }
    
    /**
     * 获得好友列表
     * @return array
     */
    public function getFriend() {
        return $this->friend;
    }

    /**
     * 获得群列表
     * @return array
     */
    public function getGroup() {
        return $this->group;
    }
    
    /**
     * 返回登录用户的信息
     * @return array
     */
    public function getLoginUserInfo() {
        return $this->loginUserInfo;
    }

}
